Many Internet services involve the storage and update of user data. The ability to accurately determine when and how to store and update the user data is important for improving the performance of the website service.
In existing Internet service platforms, when a user accesses a website, the user data is typically updated in one of the following ways:
1) stop-and-wait. When a user accesses a web page, web server code associated with the web page is executed step by step to identify the identity of the user, obtain service data, organize and present the user data, and eventually make any updates to the user data. The web server typically stops and waits, and a web page desired by the user is presented to the user only if all the steps in the code are finished. While this technique provides data information accurately and in real-time, it has the disadvantage that the user may have to wait for a substantial amount of time for information to be presented. Thus, this technique is more suitable for processing data pages with simple processing logic that can be obtained rapidly.
2) Asynchronous scripts. A web server implementing this technique usually preferentially executes simple logic processing and data presentation, and concurrently executes more complex and time-consuming logic processing using scripts such as JavaScript and XML (AJAX) technology. The web page initially presents partial data and is updated after the more complex and time-consuming logic processing is finished to present the finalized data. Although this technique improves the user experience, the user still have to wait for a substantial amount of time before obtaining service data generated by the complex processing logic.
3) Periodic pre-construction of data. A web server adopting this technique typically completes in advance logic processing required for enabling each user to access the intended service page and stores the resultant data. Subsequently, when the user accesses the service page, the already constructed data is presented to the user. This technique significantly improves the user experience; however, user information is not updated in real time. In addition, data is constructed in advance for all users, which can result in excessive consumption of system resources. Particularly, whenever a new service is introduced, the complexity and consumed resources of the system is proportionally increased.
4) Buffering of data. A web server adopting this technique stores any data that requires complex and time consuming logic processing in a buffer. The data is valid for a certain amount of time. When a user accesses the system, data is read out from the buffer. If no data exists in the buffer, or if the buffered data has expired, updates are made using techniques such as 1) or 2). Similar to technique 3), data buffering also improves user experience, but may increase the amount of resources consumed, especially when new services are introduced.